﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.UI.WebControls;

namespace BaseFunction
{
    public class WebControlHelp
    {
        public static string GetCheckBoxListSelected(System.Web.UI.WebControls.CheckBoxList checkboxlist)
        {
            string selected = "";
            if (checkboxlist == null)
                return "";
            foreach (ListItem li in checkboxlist.Items)
            {
                if (li.Selected)    //表示某一项被选中了
                {
                    selected = selected + li.Value + ",";
                }
            }
            if (selected.Length > 0)
            {
                selected = selected.Substring(0, selected.Length - 1);
            }
            return selected;
        }
    }
}
